﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.Http;


namespace Photograp
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            
            
            routes.MapHttpRoute(
                name: "WithActionApi",
                routeTemplate: "api/1.0/Album/{id}/{action}/{param}",
                defaults: new { controller = "Photo", param = RouteParameter.Optional }
             );

            routes.MapHttpRoute(
                name: "Default API Route",
                routeTemplate: "api/1.0/{controller}/{id}",
                defaults: new {id = RouteParameter.Optional}
            );
            routes.MapHttpRoute(
                name: "AccountApi",
                routeTemplate: "api/account/{action}/{id}",
                defaults: new { controller = "Account", id = RouteParameter.Optional }
            );

            routes.MapRoute(
                name: "UploadPhoto",
                url: "upload/Album/{id}/UploadPhotos",
                defaults: new
                {
                    controller = "Upload",
                    action = "UploadPhotos"
                }
            );
            routes.MapRoute(
                name: "Default",
                url: "{*url}",
                defaults: new { controller = "Home", action = "Index" }
            );
            
        }
    }
}